from time import sleep

from selenium.webdriver import Keys
from selenium.webdriver.common.by import By

from common.Utils import SearchDriver
#测试搜索页面首页

class SearchUI:
    url = ""
    driver = ""
    def __init__(self):
        self.url = "http://134.175.130.177:8080/"
        self.driver = SearchDriver.driver
        self.driver.get(self.url)

    def Searchui(self):
        self.driver.find_element(By.CSS_SELECTOR, "body > div > div.search > input[type=text]")
        self.driver.find_element(By.CSS_SELECTOR, "body > div > div.search > button")

    #测试搜索之后页面是否正常
    def Searchblock(self):
        self.driver.find_element(By.CSS_SELECTOR,"body > div > div.search > input[type=text]").send_keys("for")
        self.driver.find_element(By.CSS_SELECTOR,"body > div > div.search > button").click()
        self.driver.find_element(By.CSS_SELECTOR,"head > title")



#Home = SearchUI()
#Home.Searchblock()
#Home.Searchui()